# # 逻辑运算
# print(f"{1+1=}")
# print(f"{3-1=}")
# print(f"{2*3=}")
# print(f"{6/3=}")
# print(f"{5%2=}")
# print(f"{2**3=}")
# print(f"{9//4=}")
# print(f"{9.0//4=}")

# 比较运算
# name = "kijlee"
# name2 = "kijlee"
# user = "kij"
# print(name == user)
# print(name == name2)
# print(1 == 1)

# # 成员运算
# print("k" not in "kijlee")

# # 练习题验证
# print(not 2 > 1 and 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6)
# print(1 > 1 or 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6)
# print(8 or 3 and 4 or 2 and 0 or 9 and 7)
# print(0 or 2 and 3 and 4 or 6 and 0 or 3)
# print(3 > 1 and 2 or 2 < 3 and 3 and 4 or 3 > 2)

# print("登录系统")
# acount = 3
# while acount > 0:
#     acount -= 1
#     name = input("输入登录名:")
#     password = input("输入密码:")
#     if name == "kijlee" and password == "123123":
#         print("登录成功")
#         break
#     elif acount == 0:
#         break
#     else:
#         print("还有{acount}次机会".format(acount=acount))
#
# print("结束")

# print("猜年龄游戏")
# account = 3
# age = 30
# while account > 0:
#     age = int(input("输入我的年龄:"))
#     if age == 30:
#         print("恭喜猜对了")
#         break
#     else:
#         print("猜错了")
#     account -= 1
#
# print("结束")

# # 升级版猜年龄
print("升级版猜年龄")
account = 3
while account>0:
    age = int(input("输入年龄:"))
    account -= 1  # 做循环次数
    if age == 30:
        print("恭喜猜对")
        break
    elif account == 0:
        is_goon = input("是否继续玩，是输入Y否则按N:")
        if is_goon == "Y":
            account = 3
        elif is_goon == "N":
            break
    else:
        print("猜错了")
print("结束")